<?PHP
 session_start();
 include("admin/include/db.php");
 include("includes/session.php");
 
 $userId = $_SESSION['user_id'];


?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=TITLE_WEBSITE?></title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<center>
<div style="background:#179cc1; height:3px">&nbsp;</div>
<div style="width:990px;" align="center">
		<div id="header">
		<?php
    		include("includes/header.php");
   		?>
        </div>
    <div style="margin-top:20px;">
    	 <div style=" width:25%; float:left" >
        	 <?php include("includes/trainerLeftMenu.php");?>
        </div>
        <div style="width:75%;float:left">
        	<table width="600" style="border:1px solid #000" class="text" >
                        	
                            <?php

							$sqlCourses = mysql_query("SELECT * FROM software_user_courses WHERE user_id = '$userId'");
							while($resCourses = mysql_fetch_array($sqlCourses)){
								if($resCourses["assign_course"] == 'Y'){
									$stdCourse = mysql_query("SELECT time_id,courses_id,course,number_classes,category
																	
															   FROM software_users_courses_assign as SUCA 
																	INNER JOIN software_courses AS SC ON SUCA.courses_id = SC.name  
																	INNER JOIN software_user AS SU ON SU.id = SC.trainer_id       
															   WHERE user_id = '$userId' AND course = '".$resCourses["user_course"]."'");
									$resStdCourse = mysql_fetch_array($stdCourse);
									if($resStdCourse["time_id"]!="")
									{
								
							?>
                          
                           
                                <tr  height="25"   style=" background:#373737;color:#FFF; font-weight:bold;border:1px solid #000" >
									<td align="left" colspan="2" >&nbsp;<?=$resStdCourse["courses_id"]?></td>
                                  	<td align="center" ><?=$resStdCourse["number_classes"]?></td>
                            	</tr>
                                <tr>
                                	<td colspan="3">
                                    	<table width="100%" style=" border:1px solid #000" >
                                        	<tr style=" background:#DEDEDE;color:#000; font-weight:bold" height="30" >
                                                <td  width="40%" >&nbsp;Class Start Time</td>
                                                <td  width="35%" >Class End Time</td>
                                                <td  width="25%" align="center" >Send Notification</td>
                            				</tr>
                                        	<?php
												$courseTime = mysql_query("SELECT start_time,end_time,course_class 
																			FROM software_schedule_class AS SUCA where course = 'Oracle-1207071434' 
																			and  start_time BETWEEN '2012-07-10' AND '2012-07-11'");
												while($resCourseTime = mysql_fetch_array($courseTime))
												{
													$notError = 1;
											?>
                                            <tr  height="20" >
                                                <td ><img src="images/alarm.png" height="20" align="bottom"   /> &nbsp;<?=$resCourseTime["start_time"]?></td>
                                                <td ><img src="images/alarm.png" height="20" align="bottom"   />&nbsp;<?=$resCourseTime["end_time"]?></td>
                                                 <td align="center"  > &nbsp;<input type="button" id="email" name="email" value="Notification"  /></td>
                            				</tr>
                                            <?php
											
												}
												if(!$notError)
												{
											?>
                                            <tr height="30" >
                                                <td class="clsError" colspan="3" >No,Class Today</td>
       
                            				</tr>
                                            <?php
												}
											?>
                                             <tr height="30" >
                                                <td  colspan="3" >&nbsp;</td>
       
                            				</tr>
                                        </table>
                                     </td>
                                </tr>
                             
							<?php
                                 }
								 
								}
								 else{
							?>
							 <tr>
                             	<td colspan="3" class="clsError" height="30">No,Course Assign</td>
                             </tr>
                             <tr>
                             	<td colspan="3" height="30">&nbsp;</td>
                             </tr>
							<?php
									 
								 }
							 }
							?>
							
						</table>
        	
        </div>
        <div style="clear:both"></div>
    </div>
    
    <div style="margin-top:23px; margin-bottom:21px" align="center" >
    	<?php
									$sqlAdvertise = mysql_query("SELECT * FROM software_advertise 
																	WHERE 
																		banner_status = 'Y' AND banner = 2
																		ORDER BY RAND()
																		");
									$resAdvertise = mysql_fetch_array($sqlAdvertise);
							
									$imgPath  = 'admin/upload_images/'.$resAdvertise["banner_image"];
									
								?>
								
    </div>
   </div>
   <div id="footer">
  		<?php include("includes/footer.php")?>
   </div>
</div>
	</div>
</center>
</body>
</html>
